<?php

require_once 'db.php';

class work extends DB {

    public function works1() {
        $this->getConnection();
        $query = "SELECT * FROM works LIMIT 0,30";
        $work = $this->query($query);
        return $work;
    }

    public function select($query) {
        $works = $this->query($query);
        return $works;
    }
    public function update($data) {
        $this->getConnection();
        $query = 'UPDATE works
                  set image="'.$data['image'].',"
                      name="'.$data['name'].',"
                      url="'.$data['url'].',"
                      location="'.$data['location'].'"
                  where id="'.$data['id'].'"';
        return $this->query($query);
        var_dump($query);
    }
}

